
#pragma once

#include <string>

#include "mesh.h"
#include "cmnBlocks.h"

namespace EggNine {

class SimpleMesh : public PresentableMesh {
    ModelBlock::SModel          m_modelData;
    MaterialBlock::SMaterial    m_material;

    GLuint  m_vaoId;
    GLuint  m_vbo;
    GLuint  m_indxBuff;
    GLuint  m_diffTex;
    unsigned    m_indices;

    const ModelBlock*       m_uniformModel;
    const MaterialBlock*    m_uniformMaterial;

    struct vertex {
        float pos[3];
        float norm[3];
        float tex[2];
    };

public:
    SimpleMesh(const std::string& fileName);
    ~SimpleMesh();

    void Draw(const IProgram* pTechnique);
    void AttachUniforms(const UniformMap& uBlocks);
    void MapAttributes(const ProgramsMap& tMap);
};


} // EggNine
